var AdminCommon = function () {
	   	
var selectOperator = function () {
        
		$('#operator_id').change(function(){    
			var operator_id = $('#operator_id').val();
			$('#branch_operator_id').empty().append('<option value="">选择分支机构</option>');

			$.ajax({
                type: "GET",
                url: '/admin/operator/get',
                data: {operator_id:operator_id},
               
                error: function(){  
					alert('fail');  
				},  
                success: function(data){
					data = JSON.parse(data);
					var options = data;
	                $.each(options, function(i) {
	                    $('#branch_operator_id').append('<option value="' + options[i].operator_id + '">' + options[i].operator_name + '</option>');
	                });                	
                }
            });
		})  
		
		
		
	}	
		
	var cancelButton = function() {
		$('#cancel').click(function() {
			window.location.href = '/admin/lists/get';
		});

	}
	
    return {
        //main function to initiate the module

        init: function () {
    	
    		cancelButton();
    		selectOperator();
    		
        }
    };

}();